All Questions
2 questions
1vote
5answers
1kviews
Replace hyphen(s) with underscore(s) within angle brackets in a file
I’m aware of how to replace string; e.g., replace hyphen with underscore in a file. However, I wish to replace all hyphens with underscore for all text that falls within angle brackets in a given file....
6votes
5answers
9kviews
How to add an attribute in a tag in XML file by command-line?
I am trying to add field at the end of tag using sed script. Suppose I have a tag in XML file: <book name="Sed tutorial" price="250"/> Now I want to add field as Book_Width="A" after end of <...